import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'  
import BaiduMap from 'vue-baidu-map-3x'
import './assets/main.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// console.log(import.meta.env);


const app = createApp(App)
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'Ur4KkG6on1f6fgFnFntkE2A8HfYgFyGK',
  // v:'2.0',  // 默认使用3.0
  // type: 'WebGL' // ||API 默认API  (使用此模式 BMap=BMapGL)
});
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 把pinia引来 use一下
app.use(createPinia())
app.use(router)
.use(ElementPlus)
.use(ElementPlus, {
    locale: zhCn,
})

app.mount('#app')
